package biz

import (
	"context"

	new_admin "code.bydev.io/cht/customer/kyc-stub.git/pkg/bybit/kyc/admin/v1"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycadminapi/dto"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycadminrepo/o_kyc_action_state"
	"code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycadminrepo/o_kyc_record_common"
	kpdto "code.bydev.io/cht/customer/kyc_admin_service/internal/pkg/kycprovider/dto"
	"code.bydev.io/cht/customer/kyc_dbstructure.git/pkg/o_kyc_action_image"
	"code.bydev.io/cht/customer/kyc_dbstructure.git/pkg/o_kyc_country_config"
	"git.bybit.com/svc/dbstructure_user/pkg/o_member_kyc_record"
	"git.bybit.com/svc/go/pkg/bdal"
)

type KycAdminRepo interface {
	// GetActionList KYC 认证记录查询
	GetActionList(ctx context.Context, data *dto.ActionListCondition) ([]*o_kyc_action_state.Record, int64, error)
	// GetActionDetail KYC 认证查询详细
	GetActionDetail(ctx context.Context, data *dto.ActionDetailCondition) (*o_kyc_action_state.Record, error)
	// GetKYCRecordCommon 查询kyc_reord_common记录
	GetKYCRecordCommon(ctx context.Context, memberID int64) (*o_kyc_record_common.Record, error)
	GetMemberKYCRecord(ctx context.Context, memberID int64) (*o_member_kyc_record.Record, error)
	GetCountryConfigList(ctx context.Context, condition *dto.CountrySearchCondition) ([]*o_kyc_country_config.Record, int, error)
	SetCountryConfig(ctx context.Context, config *o_kyc_country_config.Record) error
	GetDocSubtypeConfig(ctx context.Context) (*new_admin.DocSubtype, error)
	SetDocSubtypeConfig(ctx context.Context, config *new_admin.DocSubtype) error
	GetTarTransferChain(ctx context.Context, memberID int64, idempotentID string) (string, error)
	GetSrcTransferChain(ctx context.Context, memberID int64, idempotentID string) (string, error)
	// GetInitRecords 获取初始化的记录
	GetInitRecords(ctx context.Context, limit int) ([]*o_kyc_action_image.Record, error)
	// ActionImageComplete 创建action images
	ActionImageComplete(ctx context.Context, record *o_kyc_action_image.Record, doc *kpdto.Document) error
	// GetCompleteByImgID 创建action images
	GetCompleteByImgID(ctx context.Context, memberID int64, provider int8, imgID string) (*o_kyc_action_image.Record, error)
	// IsRecordDone 判断记录是否完成
	IsRecordDone(ctx context.Context, id int64) (bool, error)
	// GetActionByIdempotentID 根据idempotentID获取记录
	GetActionByIdempotentID(ctx context.Context, idempotentID string) (*o_kyc_action_state.Record, error)
	// GetOnfidoApprovedPOIRecords 获取Onfido已经通过的POI记录
	GetOnfidoApprovedPOIRecords(ctx context.Context, startID int64, limit int) ([]*o_kyc_action_state.Record, error)
	GetRecordsByIdempotentID(ctx context.Context, idempotentID string) ([]*o_kyc_action_image.Record, error)
	CreateActionImages(ctx context.Context, session *bdal.TX, images []*kpdto.KYCActionImage) error
	GetInitRecordsByStartID(ctx context.Context, startID int64, limit int) ([]*o_kyc_action_image.Record, error)
	MarkImageNotFound(ctx context.Context, record *o_kyc_action_image.Record) error
	GetInitSelfieRecords(ctx context.Context, limit int) ([]*o_kyc_action_image.Record, error)
	GetLatestMonthInitStatusRecords(ctx context.Context, limit int) ([]*o_kyc_action_image.Record, error)
}
